import { Fragment, Suspense } from "react"
import { ConfigProvider, Spin, App as AntApp } from 'antd';
import 'antd/dist/reset.css';
import useGuard from "@/router/useGuard"
import routes from "@/router/routes"
import Layout from "@/layout";
const App = () => {
  //使用自己封装的路由守卫
  let RouteElement: React.ReactNode = useGuard('qf-token', routes)
  return (
    <ConfigProvider theme={{ token: { colorPrimary: 'deeppink' } }}>
      <Layout>
        <AntApp>
          <Suspense>
            {RouteElement}
          </Suspense>
        </AntApp>
      </Layout>
    </ConfigProvider>

  )
}

export default App